<template>
  <el-dialog
    :visible.sync="isConnect"
    width="600px"
    :show-close="false"
    :before-close="handleClose"
  >
    <div class="wallet">
      <div class="closeW">
        <img
          src="@/assets/img/close.png"
          alt=""
          class="close"
          @click="handleClose"
        />
      </div>
      <div class="walletTitle">
        <span>Connect Wallet</span>
        <span>Please connect a wallet to use this dapp</span>
      </div>
      <div class="wallets">
        <div class="item" @click="connectWallet">
          <img src="@/assets/img/hl.png" alt="" />
          <span>MetaMask</span>
        </div>

        <div class="item noConnect">
          <img src="@/assets/img/wallet_1.png" alt="" />
          <span class="noConnect">WalletConnect</span>
        </div>

        <div class="item noConnect">
          <img src="@/assets/img/wallet_2.png" alt="" />
          <span class="noConnect">WalletLink</span>
        </div>

        <div class="item">
          <img src="@/assets/img/wallet_3.png" alt="" />
          <span class="noConnect">Portis</span>
        </div>
      </div>
    </div>
  </el-dialog>
</template>
<script>
export default {
  props: {
    isConnect: {
      type: Boolean,
      default: false,
    },
  },
  data () {
    return {};
  },
  methods: {
    handleClose () {
      this.$emit("isConnectWallet");
    },
    connectWallet () {
      this.$parent.connectWallet()
      this.$parent.isAddress = false
      this.$emit("isConnectWallet");
    }
  },
};
</script>
<style scoped lang='scss'>
.wallet {
  display: flex;
  flex-direction: column;
  padding: 30px;
  box-sizing: border-box;
  padding-top: 0;
}
.closeW {
  width: 500px;
  text-align: right;
  .close {
    width: 26px;
    cursor: pointer;
  }
}
.walletTitle {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;

  span:nth-child(1) {
    color: #000000;
    font-size: 21px;
    font-weight: 600;
    margin-bottom: 10px;
  }
}
.wallets {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-top: 20px;
  .item {
    cursor: pointer;
    width: 230px;
    height: 55px;
    display: flex;
    align-items: center;
    background-color: #fff;
    margin: 10px 0;
    border-radius: 8px;
    span {
      font-size: 18px;
      font-weight: 600;
      color: #000;
    }
    .noConnect {
      color: #cccccc;
    }
  }
  img {
    width: 40px;
    height: 40px;
    margin-right: 20px;
    margin-left: 30px;
  }
}
</style>
<style scoped lang="scss">
/deep/.el-dialog__header {
  padding: 0 !important;
}
/deep/ .el-dialog {
  border-radius: 30px !important;
  background-color: #f9f4f4 !important;
}
</style>